package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dao.UrlsDao;
import entity.Urls;
import biz.UrlsBiz;

public class UrlsBizImpl implements UrlsBiz {
	private UrlsDao urlsDao;
	
	public int add(Urls url) {
		return urlsDao.add(url);
	}
	public int delete(Urls url) {
		return urlsDao.delete(url);
	}
	public int update(Urls url) {
		return urlsDao.update(url);
	}
	public List<Urls> findByPage(Integer pageNo, Integer rows) {
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		return urlsDao.findByPage(map);
	}
	public Integer count() {
		return urlsDao.count();
	}
	public List<Urls> findByParam(Map map) {
		return urlsDao.findByParam(map);
	}

	public Urls findById(Integer id) {
		return urlsDao.findById(id);
	}
	
	
	public UrlsDao getUrlsDao() {
		return urlsDao;
	}
	public void setUrlsDao(UrlsDao urlsDao) {
		this.urlsDao = urlsDao;
	}
	public List<Urls> findByUserId(Integer id) {
		return urlsDao.findByUserId(id);
	}
}
